#include "sys.h"


void RCC_Configuration(void)
{
	ErrorStatus isHSEStartUp;
	RCC_DeInit();
	RCC_HSEConfig(RCC_HSE_ON);
	 
	if (isHSEStartUp==SUCCESS){
		RCC_PLLConfig(RCC_PLLSource_HSE_Div1,RCC_PLLMul_9);
		RCC_PLLCmd(ENABLE);
		while (RCC_GetFlagStatus(RCC_FLAG_PLLRDY)==RESET);
		RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);	
		while (RCC_GetSYSCLKSource() != 0x08);
		RCC_HCLKConfig(RCC_SYSCLK_Div1);
		RCC_PCLK1Config(RCC_SYSCLK_Div2);
		RCC_PCLK2Config(RCC_SYSCLK_Div1);
		FLASH_SetLatency(FLASH_Latency_2);
		FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
	}
}
